﻿
using L.M.Review.Application.IServices;
using L.M.Review.Domain.DTO;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace L.M.Review.Read.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class Approval_formController : ControllerBase
    {
        private readonly IApproval_formServices approval_FormServices;
        public Approval_formController(IApproval_formServices approval_FormServices)
        {
            this.approval_FormServices = approval_FormServices;
        }

        /// <summary>
        /// 获取所有的审批
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> GetShowSystem()
        {
            var list =await approval_FormServices.GetShowQueryableAsync(c => c.approval_on_no == true);
            return Ok(list.ToList()); 
        }

        /// <summary>
        /// 显示所有的审批单
        /// </summary>
        /// <returns>显示所有的审批单</returns>
        [HttpGet]
        public async Task<IActionResult> GetappList()
        {
            return Ok(await approval_FormServices.GetappList());
        }


    }
}
